package com.zy.springboot.service.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by y on 2019/1/11.
 */
@Slf4j
@Component
//@EnableScheduling   //开启定时任务
public class ScheduledService {
    @Scheduled(cron = "0/5 * * * * *")
    public void scheduled(){
         System.out.println("123213123123");
        log.info("=====>>>>>使用cron {}",System.currentTimeMillis());
    }
}
